package com.csjbot.alicemobilecontrol.tool;

import java.util.Locale;

/**
 * Created by Administrator on 2017-09-21.
 */

public class Contant {

    public static final String BTN_1 = "btn_1";
    public static final String BTN_2 = "btn_2";
    public static final String BTN_3 = "btn_3";
    public static final String BTN_4 = "btn_4";
    public static final String BTN_5 = "btn_5";
    public static final String BTN_6 = "btn_6";
    public static final String BTN_7 = "btn_7";
    public static final String BTN_8 = "btn_8";
    public static final String BTN_9 = "btn_9";
    public static final String BTN_10 = "btn_10";
    public static final String BTN_11 = "btn_11";
    public static final String BTN_12 = "btn_12";
    public static final String BTN_13 = "btn_13";
    public static final String BTN_14 = "btn_14";
    public static final String BTN_15 = "btn_15";
    public static final String BTN_16 = "BTN_16";
    public static final String BTN_17 = "BTN_17";
    public static final String BTN_18 = "BTN_18";
    public static final String BTN_19 = "BTN_19";
    public static final String BTN_20 = "BTN_20";
    public static final String BTN_21 = "BTN_21";

    public static final String BTN_POINT_1 = "BTN_POINT_1";
    public static final String BTN_POINT_2 = "BTN_POINT_2";
    public static final String BTN_POINT_3 = "BTN_POINT_3";
    public static final String BTN_POINT_4 = "BTN_POINT_4";
    public static final String BTN_POINT_5 = "BTN_POINT_5";


    public static final String SMILE = "{\"msg_id\":\"SET_ROBOT_EXPRESSION_REQ\",\"expression\":5003,\"once\":1,\"time\":0}";
    public static final String CRY = "{\"msg_id\":\"SET_ROBOT_EXPRESSION_REQ\",\"expression\":5001,\"once\":1,\"time\":0}";

    public static final String GET_POINT = "{\"msg_id\":\"NAVI_GET_CURPOS_REQ\"}";
    public static final String NAVI_TO = "{\"msg_id\":\"NAVI_ROBOT_MOVE_TO_REQ\",\"pos\":{\"x\":%f,\"y\":%f,\"z\":0,\"rotation\":%f}}";

    public static final String GO_FORWORD = "{\"msg_id\":\"NAVI_ROBOT_MOVE_REQ\",\"direction\":0}";
    public static final String GO_BACK = "{\"msg_id\":\"NAVI_ROBOT_MOVE_REQ\",\"direction\":1}";
    public static final String TURN_LEFT = "{\"msg_id\":\"NAVI_ROBOT_MOVE_REQ\",\"direction\":2}";
    public static final String TURN_RIGHT = "{\"msg_id\":\"NAVI_ROBOT_MOVE_REQ\",\"direction\":3}";


    // 肢体部位
    public static class BodyPart {
        // 1重置
        public static final int RESET = 1;
        // 2头部关节
        public static final int HEAD = 2;
        // 3左大臂关节
        public static final int LEFT_ARM = 3;
        // 4右大臂关节
        public static final int RIGHT_ARM = 4;
        // 5双大臂关节
        public static final int DOUBLE_ARM = 5;
        // 6左小臂关节
        public static final int LEFT_FOREARM = 6;
        // 7右小臂关节
        public static final int RIGHT_FOREARM = 7;
        // 8双小臂关节
        public static final int DOUBLE_FOREARM = 8;
        // 腰部关节
        public static final int WAIST = 9;
    }


    // 动作
    public static class BodyAction {
        // 1无动作
        public static final int NONE = 1;
        // 2左转上
        public static final int LEFT_UP = 2;
        // 3右转下
        public static final int RIGHT_DOWN = 3;

        /**
         * 注意：action的4、5、6、7、8仅对头部电机有用。
         */

        // 4左右转
        public static final int LEFT_THEN_RIGHT = 4;
        // 5上转
        public static final int UP = 5;
        // 6下转
        public static final int DOWN = 6;
        // 7上下转
        public static final int UP_AND_DOWN = 7;
        // 上下停止
        public static final int HEAD_UP_AND_DOWN_STOP = 8;
        // 开始摆手
        public static final String ROBOT_ARM_LOOP_START_REQ = "ROBOT_ARM_LOOP_START_REQ";
        // 停止摆手
        public static final String ROBOT_ARM_LOOP_STOP_REQ = "ROBOT_ARM_LOOP_STOP_REQ";
    }


    public static String upLeftHand = String.format(Locale.getDefault(),
            "{\"msg_id\":\"ROBOT_BODY_CTRL_CMD\",\"body_part\":%d,\"action\":%d}", BodyPart.LEFT_ARM, BodyAction.LEFT_UP);
    public static String downLeftHand = String.format(Locale.getDefault(),
            "{\"msg_id\":\"ROBOT_BODY_CTRL_CMD\",\"body_part\":%d,\"action\":%d}", BodyPart.LEFT_ARM, BodyAction.RIGHT_DOWN);
    public static String upRightHand = String.format(Locale.getDefault(),
            "{\"msg_id\":\"ROBOT_BODY_CTRL_CMD\",\"body_part\":%d,\"action\":%d}", BodyPart.RIGHT_ARM, BodyAction.LEFT_UP);
    public static String downRightHand = String.format(Locale.getDefault(),
            "{\"msg_id\":\"ROBOT_BODY_CTRL_CMD\",\"body_part\":%d,\"action\":%d}", BodyPart.RIGHT_ARM, BodyAction.RIGHT_DOWN);
    public static String diantou = String.format(Locale.getDefault(),
            "{\"msg_id\":\"ROBOT_BODY_CTRL_CMD\",\"body_part\":%d,\"action\":%d}", BodyPart.HEAD, BodyAction.UP_AND_DOWN);
    public static String yaotou = String.format(Locale.getDefault(),
            "{\"msg_id\":\"ROBOT_BODY_CTRL_CMD\",\"body_part\":%d,\"action\":%d}", BodyPart.HEAD, BodyAction.LEFT_THEN_RIGHT);
}
